<?php echo $header; ?>
<script type="text/javascript" src="catalog/view/javascript/cartzx.js"></script>
<link href="catalog/view/theme/default/stylesheet/add.css" rel="stylesheet" type="text/css" />
<style>
.item {
    border-bottom: 1px solid #EBE9E8;
    cursor: pointer;
    padding: 12px 10px 5px 0;
    text-align: right;
    text-transform: none;}
.item:hover{
	background-color:#EDEBEB;
	}
.name_container {
    float: left;
    margin-left: 10px;
    text-align: left;
}
.name_container .name {
    font-size: 1.1em;
    padding-bottom: 1px;
    text-transform: none;
}
.name_container .name {
    font-size: 1.1em;
    text-transform: none;
}
.name_container .description {
    margin-bottom: 2px;
    margin-top: 1px;
    width: 430px;
}

.add_items {
    display: block;
    position: absolute;
    visibility: visible;
}
.menu_list .section li .price {
    color: #8FA201;
    font-family: HelveticaNeueLTPro65Medium,Helvetica,Arial;
    font-size: 1.01em;
    font-weight: normal;
    letter-spacing: 0.3px;
}

.menu_list .menuSectionItems {
    padding-bottom: 25px;
}
.clearer {
    clear: both;
}

 .menuSectionHeadline {
    color: #432A1F;
    font-size: 1.8em;
    font-weight: normal;
    letter-spacing: 0.02em;
    margin-top: 0.8em;
    padding: 7px 10px 3px;
    text-transform: uppercase;
}

.sectionTitle {
    background-color: #EBE9E8;
    border-bottom: 1px solid #AAA29D;
    margin-bottom: 5px;
}
</style>

<?php if(isset($productlist)){ ?>
	<?php foreach ($productlist as $key=>$value){ ?>				
			<div id="menu_section-<?php echo $value['category_id'];?>" class="section">	
			
					<img src="<?php echo $value['image']?>" >
				<div class="sectionTitle">																							
					<h3 class="menuSectionHeadline">	
					<a class="descriptionCollapse" href="#<?php echo $value['category_id'];?>" onclick="rotfl('menu_section-163'); return false;">    
					<img class="expandarrow" src="catalog/view/theme/default/image/triangle_down.png" />	            
					</a><?php echo $value['name'];?>		</h3>
					<div class="clearer">	</div>	
				</div>		
				
				<div class="clearer"></div>	
				<ul class="menuSectionItems">
					
					<li class="item"  id="menu_item-famous-star-hamburger" onclick="addToCartzx(<?php echo $value['products']['product_id'];?>, '1',<?php echo count($value['products']['option']) ?>); return false;">
						<div class="name_container">								
						<div class="name">	    						
						<span class="menu_item_names"><?php echo $value['products']['name'];?>	 </span>		
						</div>	
						</div>	
						<span class="price"><?php echo $value['products']['price'];?></span>		
						<div class="clearer"></div>			
					</li>	
						<div class='product_info' id="product_info_<?php echo $value['products']['product_id'];?>" style='display:none;position: absolute; margin: 0px; top: 350px; left: 294px;'>
							<?php if(is_array($value['products']['option']) && !empty($value['products']['option'])){?>
							<span class="add_items">		<img src="catalog/view/theme/default/image/plus_2.png" />	</span>	
							
							<?php foreach($value['products']['option'] as $option){?>

								<?php if ($option['type'] == 'radio') { ?>
									<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
									  <?php if ($option['required']) { ?>
									  <span class="required">*</span>
									  <?php } ?>
									  <b><?php echo $option['name']; ?>:</b><br />
									  <?php foreach ($option['product_option_value'] as $option_value) { ?>
									  <input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" />
									  <label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
										<?php if ($option_value['price']) { ?>
										(<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
										<?php } ?>
									  </label>
									  <br />
									  <?php } ?>
									</div>
									<br />
							<?php } ?>
							<?php if ($option['type'] == 'checkbox') { ?>
								<div id="option-<?php echo $option['product_option_id']; ?>" class="option">
								  <?php if ($option['required']) { ?>
								  <span class="required">*</span>
								  <?php } ?>
								  <b><?php echo $option['name']; ?>:</b><br />
								  <?php foreach ($option['product_option_value'] as $option_value) { ?>
								  <input type="checkbox" name="option[<?php echo $option['product_option_id']; ?>][]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" />
								  <label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
									<?php if ($option_value['price']) { ?>
									(<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
									<?php } ?>
								  </label>
								  <br />
								  <?php } ?>
								</div>
								<br />

							<?php } ?>	
								
								
							<?php } ?>
							<span class='confirm-cart' id='confirm' onclick="addalltocartzx(<?php echo $value['products']['product_id'];?>, '1')" >
								确认
							</span>
							
							<?php }?>
							</div>
						
				</ul>
		           
				<div class="section_end" style="clear: left; height: 1px; width: 1px;"></div>	
			
			</div>										
		<?php }?>				
	<?php }?>																						
		
	

	<?php echo $footer; ?>
<script>
$(document).ready(function(){
  $.ajax({
		url: 'index.php?route=checkout/cartzx/get',
		type: 'post',
		data: 'action=getcartzx',
		dataType: 'json',
		success: function(msg) {
			$('.success, .warning, .attention, .information, .error').remove();
			$("#cart_list").empty();
			$("#cart_list").append(msg);
			
		
		}
	});
});
	
</script>
<div id="cart_container" class="mainwidget" style="position: relative; top: 0px;">
				

<div id="cart_containerWrapperTop">
	<span id="cart_grouporder_btns">
        <a id="cart_new" tooltip="清空购物车." style="" class="button_active">
        </a>
    </span>
	<h3 id="cart_headline">购物车</h3>

</div>
<div id="cart_containerWrapperCenter">
	<div id="cart_header">
		
	</div>
	<div id="cart_items" style="max-height: 500px;"><div class="namedCart active">
	
		<ul style="" id="cart_list" >
			
			
		</ul>
		<div id="cart_empty_warning" style="display: none;">请在购物车内加入您想买的东西。</div>
	</div>
</div>
<ul id="cart_meta">
    <li id="discount_line" class="item discount" style="display: none;">
		<span class="name">折扣</span>
		<span class="price"></span>
	</li>
    <li id="package_price_line" class="item package_price" style="display: none;"><span class="name">包装</span>
		<span class="price"></span>
	</li>
    <li id="delivery_fee_line" class="item devfee" style="display: block;">
            <span id="cart_delivery_fee_explanation">固定运费（餐点运费由餐厅或快递收取，而非外卖超人）</span>
        <span class="price">16.00 RMB</span>
    </li>
    <li class="item sum">
        <div id="sum_line">
            <span class="name">总额</span><span class="price">80.00 RMB</span>
        </div>
    </li>
</ul>

<div id="cart_warning" style="display: none;"></div>
<div id="cart_timeleft" style="display: none;"></div>

<div id="cart_btns" class="zh" style="">
	<div id="cart_btn_finish" style="display: none;" class="cartButton png">
		<a></a>
	</div>

	<div id="cart_btn_order" style="" class="cartButton png button_active">
		<a id="cartDummyButton" class="cartButton buttonSecondary">
			<table>
				<tbody><tr>
					<td class="sliceLeft"></td>
					<td class="sliceCenter">确认订单</td>
					<td class="sliceRight"></td>
				</tr>
			</tbody></table>
		</a>
	</div>
</div>


</div>

<div id="cart_containerWrapperBottom">
	

		

			
				<div class="withCentralBilling">
					<!-- <div class="cashPaymentIcons" tooltip="现金支付"></div> -->
					<!-- <div class="onlinePaymentIcons" tooltip="付款"></div> -->
					<div class="listIcon"><img class="listIcon" src="catalog/view/theme/default/image/coupon_zh.png"></div>
				</div>
			

	    

	
	
</div>

		</div>